package com.wind.trademark.user.controller;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wind.trademark.base.vo.NodeVo;
@Controller
public class PermissionController {

	
	private static final Log log = LogFactory.getLog(PermissionController.class);

    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	

	@RequestMapping
	public @ResponseBody  List<NodeVo> loadPermissionsByRoleId(Long roleId) throws IOException{
		
		NodeVo nodeVo1=new NodeVo();
		nodeVo1.setId("1");
		nodeVo1.setText("1");
		NodeVo nodeVo11=new NodeVo();
		nodeVo11.setId("11");
		nodeVo11.setText("11");	
		nodeVo11.setExpandable(false);
		nodeVo1.getChildren().add(nodeVo11);

		NodeVo nodeVo12=new NodeVo();
		nodeVo12.setId("12");
		nodeVo12.setText("12");	
		nodeVo12.setLeaf(true);
		nodeVo1.getChildren().add(nodeVo12);
		
		NodeVo nodeVo13=new NodeVo();
		nodeVo13.setId("13");
		nodeVo13.setText("13");	
		nodeVo1.getChildren().add(nodeVo13);
		
		List<NodeVo> list=new ArrayList<NodeVo>();
		list.add(nodeVo1);
		return list;
	}
//	response.getWriter().write("[{text:'01',children:[{text:'01-01',leaf:true},"
//			  +"{text:'01-02',children:[{text:'01-02-01',leaf:true},{text:'01-02-02',leaf:true}"
//			  +"]},{text:'01-03',leaf:true}]},{text:'02',leaf:true}]");
}
